home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 015a / sw_44b.zip / DI-14.DOC next >
Text File  |  1992-12-20  |  10KB  |  233 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                             
  10.                        ┌────────────────────────────┐  
  11.                        │                            │░░
  12.                        │           DI.EXE           │░░
  13.                        │      Disk Information      │░░
  14.                        │                            │░░
  15.                        │           ▄▀▀▀▀▄           │░░
  16.                        │           █    █           │░░
  17.                        │            ▀▀▀▀            │░░
  18.                        │            ┌──┐            │░░
  19.                        │   Ver 1.4  │  │  (c) 1992  │░░
  20.                        │            │  │            │░░
  21.                        │            └──┘            │░░
  22.                        └────────────────────────────┘░░
  23.                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                               December 20, 1992
  59.  
  60.                                  INTRODUCTION
  61.  
  62.      The  SW package  contains  the  companion  program, DI.EXE.  This  little
  63. utility will be indispensable for those batch files that require the  informa-
  64. tion about a disk or drive.  If you've ever had your  nice SW screen messed up
  65. with DOS error messages, you'll love DI!
  66.  
  67.      The program puts  all the little disk checking  functions in one easy  to
  68. use package. With it you  can check the validity of a drive letter input  from
  69. the user, drive status,  disk status, and identify  the current drive. You can
  70. even access  the Volume label on  a disk to  verify that the user  has put the
  71. proper disk in the drive. Volume labels can be changed too. You  can even make
  72. sure there's enough space for copying files or check the PATH for a file.
  73.  
  74.     SYNTAX: DI [drive:] /switch [label | filespec | size | varname] [/CD]
  75.  
  76.      The  first parameter  indicates the  drive on  which the operation  is to
  77. take  place. If it is left out, the default drive will  be used. These are the
  78. switches:
  79.  
  80.      /VALID - Check drive to verify its existence.
  81.      /READY - Check drive to see if a disk is present.
  82.      /WRITE - Check disk write-protect status.
  83.      /ID - Return current drive #. A=1, B=2, etc.
  84.      /SPACE - Check disk for available space.
  85.      /SIZE - Check disk size. Returns EL code.
  86.      /TYPE - Check device type. Returns EL code.
  87.      /EXIST - Check PATH for a file. /CD to change to location.
  88.      /FIND - Locate file on drive. /CD to change to location.
  89.      /MATCH_VOL - Check for proper Volume ID.
  90.      /NEW_VOL - Change Volume ID.
  91.      /DEL_VOL - Delete Volume ID.
  92.      /GET_VOL - Get Volume ID. Returned to environment.
  93.  
  94.      The third  parameter is  used with  the  /SPACE, /EXIST,  /FIND, /ID  and
  95. Volume ID switches.
  96.  
  97. /VALID  /READY  /WRITE 
  98.      These switches check  the state of the  drive. /VALID merely verifies the
  99.      existance  of  the device.  /READY  determines  if  a  formatted disk  is
  100.      present. /WRITE checks the write protection  status. All of these  return
  101.      an EL  0 (Errorlevel 0) if  true and  an EL 1 if  not. Additionally, they
  102.      will return an EL 2 if a bad or unformatted disk is present.
  103.  
  104. /ID 
  105.      This  switch  identifies  the  current  drive.  The  Errorlevel  returned
  106.      corresponds to  the drive number where A=1, B=2, etc. You can then set an
  107.      environment variable to be used to return  to that drive at any  point in
  108.      your  batch file. If  you use DOS 3.3 or higher,  DI /ID can save you the
  109.      trouble  by returning  the drive  letter directly  into the  environment.
  110.      Just add the variable name (8 letters max)  you want the letter  assigned
  111.      to  after the switch.  Only the  letter is returned  so be sure  to use a
  112.      colon after it in the batch file (e.g. %DRV%:). 
  113.  
  114.  
  115.  
  116.                                       1
  117.  
  118. /SPACE
  119.      Two methods can be used to check available space. You can either  provide
  120.      a filespec such as  "c:\temp\*.exe" or the number  of KBytes in  the form
  121.      "/1024". If a filespec is provided, DI will  count the number a bytes  in
  122.      the files matching it,  calculate the clusters that will be used by  each
  123.      file, and then  check the drive  for available space. NOTE:  If providing
  124.      only  a path without a filename, end it with a \. c:\temp\ is the same as
  125.      c:\temp\*.*. Without  the \,  DI will check  c:\ for a  file named  temp.
  126.      /SPACE will work on  drives up to  4,000 MB  capacity. Returns EL 0  when
  127.      there enough  space. CAUTION: DI  does not take  into account files  with
  128.      the same name on the destination drive.
  129.  
  130. /SIZE 
  131.      This  allows you  to verify  that the  proper formatted  floppy is  in  a
  132.      drive.  This switch  returns an  EL code  based on  standard floppy  disk
  133.      formats. EL 1 - No disk,  EL 2 - bad or unformatted disk, EL 3 less  than
  134.      180 K, EL 5 - 180K, EL 6 - 360K, EL 7 - 720K, EL 8 - 1.2M,  EL 9 - 1.44M,
  135.      EL 10 - 2.88M, EL 11 greater than 2.88M. With this information you  could
  136.      then issue the proper FORMAT command.  Obviously, this switch cannot tell
  137.      you the size of a disk  that has not been formatted  and it will not tell
  138.      you how much space is actually available. Use /SPACE for that.
  139.  
  140. /TYPE
  141.      This switch will return  an EL code based on  the device type. The values
  142.      returned are similar to  the /SIZE codes. EL  1 - Error accessing device,
  143.      EL 3  - Unknown device, EL  6 - 360K,  EL 7 - 720K,  EL 8 - 1.2M,  EL 9 -
  144.      1.44M, EL 10 -  2.88M, EL 11 -  Hard Disk, EL 12  - Tape Drive,  EL 13  -
  145.      Optical  Drive. The information obtained represents the default media for
  146.      the device and does not represent what may currently be in the device.
  147.  
  148. /EXIST 
  149.      This  expands the  batch file  function  "if  exist". This  function will
  150.      search the  PATH for the filename  specified in the third parameter. This
  151.      will be  useful if  your batch file needs  to know the capabilities  of a
  152.      unfamiliar machine. The drive parameter is not used. Users of DOS 3.3  or
  153.      better have an additional  feature. Add a variable  name (8 letters  max)
  154.      after the filename and  DI will return the exact  location of the file in
  155.      the  DOS environment  in  the form  d:\dir. If  you  want the  drive  and
  156.      directory information separate, specify two  variables separated by  a \.
  157.      e.g. "DI /EXIST XCOPY.EXE d\dir"  will return "D=C" and "DIR=\DOS" in the
  158.      environment. Returns EL 0 if successful.
  159.  
  160. /FIND
  161.      This switch will locate  the FIRST occurrence of a file on the  specified
  162.      drive. The  environment variable  options described for  /EXIST apply  to
  163.      /FIND as well. Both  /FIND and /EXIST also  have the additional option of
  164.      changing to  the drive and directory  where the file  was found. Add  /CD
  165.      after the filename to make the change.
  166.  
  167. /MATCH_VOL  /NEW_VOL  /DEL_VOL  /GET_VOL
  168.      For the Volume ID functions /MATCH_VOL  and /NEW_VOL, the third parameter
  169.      is  the label  to match or the  new label respectively. No  label name is
  170.      required  for /DEL_VOL or /GET_VOL.  You can provide a  variable name for
  171.      /GET_VOL to use  as the third parameter.  Although label checking is  not
  172.      case-sensitive, labels  written to the drive  will be  all caps. /GET_VOL
  173.  
  174.                                       2
  175.  
  176.      will return the answer  in the environment using  the drive letter as the
  177.      variable  if  no  other  variable  name  is  provided.  Returns  EL 0  if
  178.      successful.
  179.  
  180.      Most of these DI  functions return EL 0 if the operation was  successful,
  181. EL 1 if not and  EL 2 if the disk  in the drive is  unformatted or bad.  While
  182. debugging  your batch files, you can  add a /D  as a last parameter to display
  183. the code returned.  Otherwise, there  is no  screen output  from this  utility
  184. except when  it receives a bad parameter  or none at  all. A short description
  185. of  the program and the switches  is displayed in that case. If you pass a bad
  186. parameter, DI will return Errorlevel 255.
  187.  
  188.      DI switches can be  shortened to 3  characters if you prefer. /EXIST  can
  189. be  /EXI, /SPACE can be /SPA,  etc. The longer  forms just make the batch file
  190. more readable. They can also be in upper, lower or mixed case.
  191.  
  192.      NOTE:  Any DI  switch that  uses  the  environment to  return information
  193. requires that you use DOS 3.3 or higher.
  194.  
  195.  ═══════════════════════════════════════════════════════════════════════════
  196.  
  197.      DI.EXE is part of the SW  shareware package. Registration information can
  198. be found at the end of the SW.EXE documentation. 
  199.  
  200. DI Ver. 1.4  December 20, 1992
  201.  
  202. Warren Small                              CIS  71076,407
  203. 35 Benjamin Street                        GEnie  W.SMALL
  204. Manchester, NH  03109                     Prodigy  RSJW31A
  205.  
  206.  
  207.                                 DI.EXE History
  208.  
  209.      1.0 - 12/1/91  Initial Release.
  210.  
  211.      1.1 -  2/2/92  New  /ID switch for  DI.EXE to return  current drive.  DOS
  212. environment  can be  used  with  /ID and  /EXIST to  return info.  DI switches
  213. /READY and /WRITE enhanced to show bad or unformatted disks.
  214.  
  215.      1.2 - 2/29/92  Added /FIND  switch to locate first occurrence  of a file.
  216. /EXIST switch enhanced  with /CD switch to change  to the drive and  directory
  217. where the file was found. /FIND also has /CD option.
  218.  
  219.      1.2a  - 3/2/92   Fixed  bug in  /EXIST and  /FIND which  caused  improper
  220. operation if file was located in the root directory and /CD was specified.
  221.  
  222.      1.3 - 6/30/92   /EXIST and /FIND enhanced  to return drive and  directory
  223. in separate  variables. Added  /SIZE to get  diskette size,  /GET_VOL to  read
  224. volume label and return in environment.
  225.  
  226.      1.4 - 12/20/92  /TYPE returns device type as EL.
  227.  
  228.  
  229.  
  230.  
  231.  
  232.                                       3
  233.